const { Schema, model } = require('mongoose');
const productsSchema = new Schema({
    name: String,
    time: String,
    number: Number,
    money:String,
    ageOfCoverage: Array,
    totalNumber: Number,
    describe: String,
    comment: Array,
    img: {
        type: String,
        
    },
    delete: {
        type: Boolean,
        default: false
    },
    state: {
        type: Number,
        default: 1
    },
    //关联班级
    belongToClassifys: {
        type: Schema.Types.ObjectId,
        ref: 'classifysModel'
    },
    
}, { versionKey: false });

const productsModel = model('productsModel', productsSchema, 'products');

module.exports.productsModel = productsModel;